<div id="content">
	<div id="ContentBody">
		<div class="RightTitle" style="margin-top: 15px;">
			员工电子档案
		</div>
		<div class="archive-type search-col" style="width: 400px; margin-bottom: 15px;">
			<label class="form-label search-l">档案类型：</label>
			<select id="typeSelect" class="form-control search-r" name="type" style="width: 250px" onchange="getArchive()">
				%bind(:1)
			</select>
		</div>

		<div id="type" style="padding: 0 15px;">
			<table id="archiveTypeList" class="table datatable dataTable">
				<thead>
		          <tr>
		                <th>档案类型</th>
		                <th class="action">档案详情</th>
						<th class="action">添加档案</th>
		            </tr>
				</thead>
				<tbody>
				</tbody>
			</table>
		</div>

		<div style="padding: 0 15px;">
			<table id="archiveList" class="table datatable dataTable">
				<thead>
		            <tr>
		                <th>子类型</th>
		                <th>文件名</th>
		                <th>详细描述</th>
		                <th>生效日期</th>
		                <th>失效日期</th>
		                <th class="action">档案状态</th>
						<th class="action">修改档案</th>
		            </tr>
				</thead>
				</tbody>
					<tr class="odd"><td colspan="14" class="dataTables_empty" valign="top">请先选择档案类型</td></tr>
				</tbody>
			</table>
		</div>
	    <div class="col-xs-12" id="PCbuttonDiv">
	        <!--modify by FZ 2024-05-29 添加档案进入默认不显示  class="btn btn-primary btn-ms fl mr_20" href="#" onclick="addArchive()">添加档案</a-->
	    </div>
	</div>

	<!--添加附件-->
	<form id="addForm" class="form-horizontal">
		<div class="modal fade" id="inputModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" ">
			<div class="modal-dialog modal-lg" style="width: 1000px">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">[关闭]</button>
						<h4 class="modal-title"></h4>
					</div>
					<div class="modal-body" style="margin-left: -30px;">
						<div class="form-group" id="sub-group">
							<label class="col-sm-2 control-label form-label">子类型：</label>
							<div class="col-sm-10">
								<select id="subType" name="subType" class="form-control" ></select>
							</div>
						</div>
						<div class="form-group" id="date-group">
							<!--modify by FZ 2024-05-16 添加id,方便后续调整描述  label class="col-sm-2 control-label form-label">生效日期：</label-->
							<label class="col-sm-2 control-label form-label"  id="effdtFromLabel">生效日期：</label>
							<div class="col-sm-4">
								<input id="effdtFrom" name="effdtFrom" class="form-control" type="text" />
							</div>
							<!--modify by FZ 2024-05-16 添加id,方便后续调整描述  label class="col-sm-2 control-label form-label"  id="effdtToLabel">失效日期：</label-->
							<label class="col-sm-2 control-label form-label"  id="effdtToLabel">失效日期：</label>
							<div class="col-sm-4">
								<input id="effdtTo" name="effdtTo" class="form-control" type="text" />
							</div>
						</div>

						<!--modify by FZ 2024-05-16 添加毕业证书,职业资格，国家技术职称区段字段   begin-->
						<!--添加毕业证书信息字段区块-->
						<div class="form-group" id="data_T06">
							<label class="col-sm-2 control-label form-label" style="margin-top: 10px;">*毕业日期：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<input id="graduateDt" name="graduateDt" class="form-control" type="text" />
							</div>
							<label class="col-sm-2 control-label form-label" style="margin-top: 10px;">毕业院校：</label>
							<div class="col-sm-4" style="margin-top: 10px; position: relative;" >
								<input id="schoolCode" name="schoolCode" class="form-control" type="text" style="display: none;" />
								<input id="schoolName" name="schoolName" class="form-control" type="text" onclick="openLov('schoolCode')"/>
								<!--span class="lovimg" onclick="openLov('schoolCode')"></span-->				
								<span id="clearInput" class="close-btn" onclick="clearLov('schoolCode')">X</button>
							</div>
							<label class="col-sm-2 control-label form-label" style="clear: both;margin-top: 10px;">*学历：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<select id="education" name="education" class="form-control"  onchange="setShcoolDefault()"></select>
							</div>

							<label class="col-sm-2 control-label form-label"  style="margin-top: 10px;" >其他院校：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<input id="otherSchool" name="otherSchool" class="form-control" type="text" />
							</div>

						    <label class="col-sm-2 control-label form-label" style="clear: both;margin-top: 10px;">*学习方式：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<select id="studyForm" name="studyForm" class="form-control" ></select>						
								</select>
							</div>

							<label class="col-sm-2 control-label form-label" style="margin-top: 10px;" >*专业名称：</label>
							<div class="col-sm-4"  style="margin-top: 10px">
								<input id="major" name="major" class="form-control" type="text" />
							</div>
							<!--2024-06-11 注释最高学历和第一学历label class="col-sm-2 control-label form-label" style="margin-top: 10px;">最高学历：</label>
							<div class="col-sm-4"  style="margin-top: 10px">
								<input id="highEduFlag" name="highEduFlag" class="form-control" type="checkbox" style="width: 18px; height: 18px;margin-top: 8px;" />
							</div>
							<label class="col-sm-2 control-label form-label" style="margin-top: 10px;">第一学历：</label>
							<div class="col-sm-4"  style="margin-top: 10px">
								<input id="firstEduFlag" name="firstEduFlag" class="form-control" type="checkbox"  style="width: 18px;height: 18px;margin-top:8px" />
							</div-->
						</div>

						<!--添加身份证字段区块-->
						<div class="form-group" id="data_T08">
							<label class="col-sm-2 control-label form-label" style="margin-top: 10px;">姓名：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<input id="displayName" name="displayName" class="form-control" type="text" disabled/>
							</div>
						    <label class="col-sm-2 control-label form-label" style="margin-top: 10px;">性别：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<select id="sexCode" name="sexCode" class="form-control" disabled="disabled"></select>						
								</select>
							</div>
							<label class="col-sm-2 control-label form-label" style="clear: both; margin-top: 10px;">出生日期：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<input id="birthDate" name="birthDate" class="form-control" type="text" disabled/>
							</div>
							<label class="col-sm-2 control-label form-label" style="margin-top: 10px;">身份证号：</label>
							<div class="col-sm-4" style="margin-top: 10px" >
								<input id="nationalId" name="nationalId" class="form-control" type="text" disabled/>
							</div>
						    <label class="col-sm-2 control-label form-label" style="clear: both;margin-top: 10px;">*州/省：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<select id="stateCode" name="stateCode" class="form-control" onchange="getCityList()" ></select>						
								</select>
							</div>
						    <label class="col-sm-2 control-label form-label" style="margin-top: 10px;">*城市：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<select id="cityCode" name="cityCode" class="form-control" ></select>						
								</select>
							</div>
							<label class="col-sm-2 control-label form-label"  style="clear: both;margin-top: 10px;">*地址：</label>
							<div class="col-sm-10" style="margin-top: 10px">
								<input class="form-control"  id="nidAddress"  name="nidAddress" type="text" />
							</div>
						</div>

						<!--添加银行卡字段区块-->
						<div class="form-group" id="data_T09">
							<label class="col-sm-2 control-label form-label" style="margin-top: 10px;">*银行ID：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<select id="bankCode" name="bankCode" class="form-control" ></select>
							</div>
							<label class="col-sm-2 control-label form-label" style="margin-top: 10px;">*账号：</label>
							<div class="col-sm-4" style="margin-top: 10px" >
								<input id="bankAccount" name="bankAccount" class="form-control" type="text" />
							</div>
						</div>
						
						<!--添加职业资格证书信息字段区块-->
						<div class="form-group" id="data_T13">
							<label class="col-sm-2 control-label form-label" style="margin-top: 10px;">*证书代码：</label>
							<div class="col-sm-4" style="margin-top: 10px; position: relative;" >
								<input id="certCode" name="certCode" class="form-control" type="text" style="display: none;" />
								<input id="certName" name="certName" class="form-control" type="text" onclick="openLov('certCode')" />
								<span id="clearInput" class="close-btn" onclick="clearLov('certCode')">X</button>
							</div>
							<!--div class="col-sm-4" style="margin-top: 10px">
								<input id="certCode" name="certCode" class="form-control" type="text" />
							</div-->
							<label class="col-sm-2 control-label form-label" style="margin-top: 10px;">其他证书名称：</label>
							<div class="col-sm-4" style="margin-top: 10px" >
								<input id="otherCertName" name="otherCertName" class="form-control" type="text" />
							</div>
						</div>

						<!--添加国家技术职称信息字段区块-->
						<div class="form-group" id="data_T14">

							<!--label class="col-sm-2 control-label form-label" style="margin-top: 10px;">评定日期：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<input id="evaluateDt" name="evaluateDt" class="form-control" type="text" />
							</div-->
							<label class="col-sm-2 control-label form-label" style="margin-top: 10px;">*职称等级：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<select id="titleLevel" name="titleLevel" class="form-control" ></select>
							</div>
							<label class="col-sm-2 control-label form-label" style="margin-top: 10px;">*职称系列：</label>
							<div class="col-sm-4" style="margin-top: 10px">
								<select id="titleSeries" name="titleSeries" class="form-control" ></select>
							</div>

							<label class="col-sm-2 control-label form-label" style="clear: both; margin-top: 10px;">*职称名称：</label>
							<div class="col-sm-4" style="margin-top: 10px; position: relative;" >
								<input id="titleCode" name="titleCode" class="form-control" type="text" style="display: none;" />
								<input id="titleName" name="titleName" class="form-control" type="text" onclick="openLov('titleCode')"/>
								<span id="clearInput" class="close-btn" onclick="clearLov('titleCode')">X</button>
							</div>
							<!--div class="col-sm-4" style="margin-top: 10px" >
								<input id="titleCode" name="titleCode" class="form-control" type="text" />
							</div-->
						</div>
						<!--modify by FZ 2024-05-16 添加毕业证书,职业资格，国家技术职称区段字段   end-->

						<div class="form-group">
							<label class="col-sm-2 control-label form-label">详细描述：</label>
							<div class="col-sm-10">
								<input class="form-control" name="descr" type="text" />
								<input name="guid" type="hidden" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label form-label">文件名：</label>
							<div class="col-sm-2">
	        					<a class="btn btn-primary btn-ms" href="#" onclick="uploadFile()">添加附件</a>
							</div>
							<div class="col-sm-8">
								<p id="filename" class="form-control-static"></p>
								<input type="hidden" name="filename" />
							</div>
							<span style="margin-left: 180px;margin-top: 15px;display: inline-block">请上传JPEG/PNG格式图片或PDF格式文件</span>
						</div>
						<input type="hidden" name="base64" />
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-primary confirm" onclick="checkArchive()">确认</button>
					</div>
				</div>
			</div>
		</div>
	</form>
	<input type="file" name="archive" style="display: none;" />


	<form id="lovForm" class="form-horizontal">
		<div class="modal fade" id="lovModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" ">
			<div class="modal-dialog modal-lg" style="width: 900px">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">[关闭]</button>
						<h4 class="modal-title"></h4>
					</div>
					<div class="modal-body" >
						<div style="padding: 0 15px;">
							<div style="display: flex" >
								<div class="form-group" id="lovsearch" style="flex:1">
								<!--
									<label class="col-sm-2 control-label form-label">学校代码：</label>
									<div class="col-sm-4"><input id="searchSchoolCode" class="form-control" type="text" /></div>
									<label class="col-sm-2 control-label form-label">学校名称：</label><div class="col-sm-4">
									<input id="searchSchoolName" class="form-control" type="text" /></div>
								-->
								</div>
								<div id="lovsearchbtn" style="width: 200px; text-align: center">
									<button type="button" class="btn" style="margin-right: 10px" onclick="resetLov()">重置</button>
									<button type="button" class="btn btn-primary confirm" onclick="queryLov(true)">查询</button>
								</div>
							</div>
							<table id="lovlist" class="table datatable dataTable">
								<thead>
								</thead>
								</tbody>
								</tbody>
							</table>
						</div>
					</div>
					<!--div class="modal-footer">
						<button type="button" class="btn btn-primary confirm" onclick="changeLov()">确认</button>
					</div-->
					</div>
				</div>
			</div>
		</div>
	</form>

	<div class="modal fade" id="msgModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" ">
		<div class="modal-dialog modal-lg" style="width: 900px">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">[关闭]</button>
					<h4 class="modal-title"></h4>
				</div>
				<div class="modal-body" >
					<div id="modal-msg" style="padding: 0 15px;">
						<!--h3 style="margin-bottom: 35px; font-weight: 600">电子档案不通过通知</h3>
						<div style="padding: 0 20px;">
							<p style="font-size: 16px">xxx,您好！</p>
							<p style="font-size: 16px; margin-bottom: 15px; text-indent: 25px">您提交的档案不通过；</p>
							<table id="msglist" class="table datatable dataTable">
								<thead>
			            			<tr>
										<th>序号</th>
										<th>档案类型</th>
						                <th>子类型</th>
						                <th>提交日期</th>
						                <th>不通过原因</th>
						            </tr>
								</thead>
								<tbody>
									<tr>
										<td><input type='hidden' name='hidden_cert_code' value='1'>1</td>
										<td><input type='hidden' name='hidden_cert_code' value='1'>1</td>
										<td><input type='hidden' name='hidden_cert_code' value='1'>1</td>
										<td><input type='hidden' name='hidden_cert_code' value='1'>1</td>
										<td><input type='hidden' name='hidden_cert_code' value='1'>1</td>
								</tbody>
							</table>
						</div-->
					</div>
			  </div>
			</div>
		</div>
	</div>
</div>
<style>
.ZebraDialogOverlay {
	z-index: 2000;
}
.ZebraDialog {
	z-index: 2001;
}

#archiveList-wrapper td {
	vertical-align: middle;
}
.lovimg{
    position: absolute;
    top: 50%;
    right: 45px;
    transform: translateY(-50%);
    cursor: pointer;
    width: 20px;
    height: 20px;
	background: url(%IMAGE(PT_PROMPT_LOOKUP_SWAN)) no-repeat left center;
	background-size: 100%;
}
.close-btn {
    position: absolute;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    color: #aaa;
    // display: none;
}
.close-btn:hover {
	   color: #000;
}
.select-row{
	background: #ccc;
}
</style>

<script>
	var effFlg = "N";
	var subFlg = "N";
	var addFlg = "N";   //添加数据标识
	var dttable = null;
	var lovtable = null;
	var lovscript = null;	// lov接口编码
	var lovvalue = null; 	// lov绑定值
	var lovArr = null;		// lov绑定code name数组
	var lovsearchArr = null;	// lov查询参数数组
    $(document).ready(function () {
		var option = {
			format: "Y-m-d",
			timepicker: false
		}
        // 设置列表容器在最小高度为窗口高度减去轮播图高度
        $("#ContentBody").css("min-height", ($("body").height() - $(".shutter").height() - 60) + "px");
		$("#effdtFrom").datetimepicker(option);
		$("#effdtTo").datetimepicker(option);
    	/*modify by FZ 2024-05-16 设置毕业日期，出生日期日期框  begin*/
         $("#graduateDt").datetimepicker(option);
         $("#nidBirthDate").datetimepicker(option);
		// 初始化日期组件-中文
		$.datetimepicker.setLocale("zh");
		/*modify by FZ 2024-05-16 设置毕业日期，出生日期日期框  end*/

		/*modify by FZ 2024-05-27 消息框  begin*/
        getMsg()
		/*modify by FZ 2024-05-27 消息框  end*/

		/*modify by FZ 2024-07-01 档案类型表格  begin*/
        //initArchiveTypeList()
		/*modify by FZ 2024-07-01 档案类型表格  end*/

    });

	function initArchiveTypeList () {
		var select = document.getElementById('typeSelect');
		var options = select.querySelectorAll('option');
		var values = [];
		options.forEach(function(option) {
		  values.push({value:option.value,name:option.text});
		});
		console.log(values); // 打印所有option的value值
		var data = '';
		values.forEach(function(item) {
			data = data + '<tr><td><input type="hidden" name="type" value=' + item.value + '>' + item.name + '</td>'
						+ '<td><a href="javascript:void(0);" onclick="hanldArchive(this, 0); return false;">档案详情</a></td>'
						+ '<td><a href="javascript:void(0);" onclick="hanldArchive(this, 1); return false;">添加档案</a></td></tr>'
		});
		$("#archiveTypeList").find("tbody").html(data);
		// $("#typeModal").modal("show");
	}

	function hanldArchive (obj, type) {
		// $("#typeModal").modal("hide");
		$("#type").hide();
		var val = $(obj).parent().parent().find("input[name='type']").val();
		console.log(obj, val);
		$("select[name='type']").val(val);
		if (type === 0) {
			getArchive();
		} else {
			getArchive()
			addArchive()
			
		}
	}

	function getMsg () {
		/*获取消息内容*/
		$.ajax({
			type: "POST",
			url: window.cfg.root_iscript +  "IScript_getArchiveMessage",
			data: {},
			dataType: "html",
			success: function(data, textStatus, jqXHR){
				// console.log(data, 'msg')
				if (data){
					$("#modal-msg").html(data);
					$("#msgModal").modal("show");
				}
			}
		})
	}
	$("#msgModal").on("hide.bs.modal", function(){
		/*关闭消息弹框内容*/
		//console.log('gb')
		$.ajax({
			type: "POST",
			url: window.cfg.root_iscript +  "IScript_UpdateArchiveMsgFlag",
			data: {},
			dataType: "html",
			success: function(data, textStatus, jqXHR){	
		    }
		})
	})

	/*modify by FZ 2024-05-27 lov框  begin*/
	function openLov (id) {
		// 1.写入查询条件和表格列
		if (id === 'schoolCode'){
			$("#lovsearch").html('<label class="col-sm-2 control-label form-label">学校代码：</label><div class="col-sm-4"><input id="searchSchoolCode" class="form-control" type="text" /></div><label class="col-sm-2 control-label form-label">学校名称：</label><div class="col-sm-4"><input id="searchSchoolName" class="form-control" type="text" /></div>');
			$("#lovlist").find("thead").html('<tr><th style="width: 30%">学校代码</th><th style="width: 70%">学校描述</th></tr>');
			lovscript = "IScript_getSchoolCode";
			lovArr = ['schoolCode','schoolName']
			lovsearchArr = ['searchSchoolCode','searchSchoolName']
		}
		if (id === 'titleCode'){
			$("#lovsearch").html('<label class="col-sm-2 control-label form-label">职称代码：</label><div class="col-sm-4"><input id="searchTitleCode" class="form-control" type="text" /></div><label class="col-sm-2 control-label form-label">职称描述：</label><div class="col-sm-4"><input id="searchTitleName" class="form-control" type="text" /></div>');
			$("#lovlist").find("thead").html('<tr><th style="width: 30%">职称代码</th><th style="width: 70%">职称描述</th></tr>');
			lovscript = "IScript_getTitleCode";
			lovArr = ['titleCode','titleName']
			lovsearchArr = ['searchTitleCode','searchTitleName']
		}
		if (id === 'certCode'){
			$("#lovsearch").html('<label class="col-sm-2 control-label form-label">证书代码：</label><div class="col-sm-4"><input id="searchCertCode" class="form-control" type="text" /></div><label class="col-sm-2 control-label form-label">证书描述：</label><div class="col-sm-4"><input id="searchCertName" class="form-control" type="text" /></div>');
			$("#lovlist").find("thead").html('<tr><th style="width: 30%">证书代码</th><th style="width: 70%">证书描述</th></tr>');
			lovscript = "IScript_getCertCode";
			lovArr = ['certCode','certName']
			lovsearchArr = ['searchCertCode','searchCertName']
		}
		// 2.给lov赋值，方便设置选中行颜色
		lovvalue = $("#" + id).val()
		// 3.查询lov
		queryLov();
	}
	function resetLov () {
		document.getElementById("lovForm").reset();
		queryLov();
	}
	// isUseSearchParams 是否使用lov查询参数
	function queryLov (isUseSearchParams) {
		var data = {};
		if (isUseSearchParams && lovsearchArr && lovsearchArr.length){
			lovsearchArr.forEach(function (i){
				data[i] = $("#" + i).val();
			})
		}
		lovtable = $("#lovlist").dataTable();
		lovtable.fnClearTable(); //清空一下table
		lovtable.fnDestroy(); //还原初始化了的datatable
		$.ajax({
			type: "POST",
			url: window.cfg.root_iscript + lovscript,
			data: data,
			dataType: "html",
			success: function(data, textStatus, jqXHR){
				$("#lovlist").find("tbody").html(data); // 插入lov表格数据
				$("#lovModal").modal("show");

		        lovtable = $("#lovlist").on("page.dt", function(){
					setTimeout(() => {
						// 翻页后设置选择项颜色
						if (lovvalue) {
							// console.log('翻页', $("#lovlist").find("input[value=" + lovvalue + "]"))
							$("#lovlist").find("input[value=" + lovvalue + "]").parent().parent().addClass("select-row");
						}
					})
				}).DataTable({
		            "bLengthChange": false,
		            "ordering": false,
		            "iDisplayLength": 10,
		            "searching": false,
		            "fnInitComplete": function () {
		                $("#lovlist_wrapper .dataTables_info").parent().addClass("col-sm-4 col-md-4 col-lg-3");
		                $("#lovlist_wrapper .dataTables_paginate").parent().removeClass("col-sm-6").addClass("col-sm-8 col-md-8 col-lg-9");
						/* $("#lovlist_wrapper .dt-toolbar-footer").css({"bottom":"30px","position":"absolute","width":"calc(100% - 30px)"});*/
						if (lovvalue) {
							// console.log('翻页', $("#lovlist").find("input[value=" + lovvalue + "]"))
							$("#lovlist").find("input[value=" + lovvalue + "]").parent().parent().addClass("select-row");
						}
		            }
		        });
			}
		})
	}
	//obj:选择的dom		id:lov输入框绑定的id 	tdId:lov表格字段id	tdName:lov表格字段名称
	function changeLov (obj, id, tdId, tdName) {
		// console.log(obj,id,tdId,tdName)
		var code = $(obj).find("input[name=" + tdId + "]").val(); // 获取选择的code
		var name = $(obj).find("input[name=" + tdName + "]").val();	// 获取选择的name
		if (lovArr && lovArr.length){
			lovArr.forEach(function (i, index){
				if (index === 0){
					$("#" + i).val(code)
				}else if (index === 1){
					$("#" + i).val(name)
				}
			})
		}
		$("#lovModal").modal("hide");
        //根据元素值，设置其他字段是否不可编辑
		switch (tdId) {
  			case "hidden_cert_code": /*证书*/
				if ($("input[name='certCode']").val() != "90"){
					document.getElementById("otherCertName").setAttribute("disabled","true");
					$("#otherCertName").val("");
				}else{
					document.getElementById("otherCertName").removeAttribute("disabled");
				}
			break;
  			case "hidden_school_code": /*学校*/
				if ($("input[name='schoolCode']").val() != "S999"){
					document.getElementById("otherSchool").setAttribute("disabled","true");
					$("#otherSchool").val("");
				}else{
					document.getElementById("otherSchool").removeAttribute("disabled");
				}
			break;
		}


	}
	function clearLov (id) {
		if (lovArr && lovArr.length){
			lovArr.forEach(function (i){
				$("#" + i).val("");
			})
		}
		 //根据元素值，设置字段编辑
		switch (id) {
  			case "certCode":  /*证书*/
					document.getElementById("otherCertName").removeAttribute("disabled");
			break;
  			case "schoolCode": /*学校*/
					document.getElementById("otherSchool").removeAttribute("disabled");
			break;
		}
	}
	$("#lovModal").on("hide.bs.modal", function(){
		document.getElementById("lovForm").reset();
	})
	/*modify by FZ 2024-05-27 lov框  end*/

	function getArchive () {
		var type = $("select[name='type'] option:selected").val();
		if (dttable) {
			dttable = $("#archiveList").dataTable();
			dttable.fnClearTable(); //清空一下table
			dttable.fnDestroy(); //还原初始化了的datatable
		}
		$.ajax({
			type: "POST",
			url: window.cfg.root_iscript +  "IScript_getArchiveItems",
			data: {
				type: type
			},
			dataType: "html",
			success: function(data, textStatus, jqXHR){
				subFlg = $(data).eq(0).val();
				effFlg = $(data).eq(1).val();
				$("#archiveList").find("tbody").html(data);

		        dttable = $("#archiveList").DataTable({
		            "bLengthChange": false,
		            "ordering": false,
		            "iDisplayLength": 10,
		            "searching": false,
		            "fnInitComplete": function () {
		                $("#archiveList_wrapper .dataTables_info").parent().addClass("col-sm-4 col-md-4 col-lg-3");
		                $("#archiveList_wrapper .dataTables_paginate").parent().removeClass("col-sm-6").addClass("col-sm-8 col-md-8 col-lg-9");
		                $("#archiveList_wrapper .dt-toolbar-footer").css({"bottom":"30px","position":"absolute","width":"calc(100% - 30px)"});
		            }
		        });
			}
		})


		/*modify by FZ 2024-05-16 添加按钮显示控制  begin*/
		$.ajax({
			type: "POST",
			url: window.cfg.root_iscript +  "IScript_displayAddButton",
			data: {
				type: type
			},
			dataType: "html",
			success: function(data1, textStatus, jqXHR){
					$("#PCbuttonDiv").html(data1);
				}
		}) 
		/*modify by FZ 2024-05-16 添加按钮显示控制  begin*/
	};

	/*modify by FZ 2024-06-17 省份和城市联动  begin*/
	function getCityList(){

			$.ajax({
			type: "POST",
			url: window.cfg.root_iscript +  "IScript_getCityList",
			data: {
				stateCode:  $("select[name='stateCode'] option:selected").val(),
				cityCode:  $("select[name='cityCode'] option:selected").val()
			},
			dataType: "html",
			success: function(data, textStatus, jqXHR){
					$("#cityCode").html(data);
				}
		}) 
		
	};
	//非大专以上时，毕业院校，默认为其他院校，且不可修改；大专以上时，可选择
	function setShcoolDefault(){

		if ($("select[name='education']").val() > "13"){
			document.getElementById("schoolCode").setAttribute("disabled","true");
			document.getElementById("schoolName").setAttribute("disabled","true");
			 $("#schoolCode").val("S999")
			 $("#schoolName").val("其他学校")
			document.getElementById("otherSchool").removeAttribute("disabled");
		}else{
			document.getElementById("schoolCode").removeAttribute("disabled");
			document.getElementById("schoolName").removeAttribute("disabled");
			document.getElementById("otherSchool").setAttribute("disabled","true");
            if ($("input[name='schoolCode']").val() == "S999"){
				$("#schoolCode").val("")
			 	$("#schoolName").val("")
			}
			
		}
	}
	/*modify by FZ 2024-06-17 省份和城市联动  end*/


	function modifyArchive (obj) {
		/*console.log($(obj).parent().parent().children(), $(obj).parent().parent().find("input[name='hidden_descr']").val());*/
		var type = $("select[name='type'] option:selected").val();
		$.ajax({
			type: "POST",
			url: window.cfg.root_iscript +  "IScript_getArchiveSubType",
			data: {
				type: type,
				subType: $(obj).parent().parent().find("input[name='hidden_subtype']").val()
			},
			dataType: "html",
			success: function(data, textStatus, jqXHR){
				if (subFlg !== "Y") {
					$("#sub-group").hide();
				} else {
					$("#sub-group").show();
					
				}
				if (effFlg !== "Y") {
					$("#date-group").hide();
				} else {
					$("#date-group").show();
				}
				$("input[name='effdtFrom']").val($(obj).parent().parent().find("input[name='hidden_effdtfrom']").val());
				$("input[name='effdtTo']").val($(obj).parent().parent().find("input[name='hidden_effdtto']").val());
				$("input[name='descr']").val($(obj).parent().parent().find("input[name='hidden_descr']").val());
				$("input[name='guid']").val($(obj).parent().parent().find("input[name='hidden_guid']").val());
				$("input[name='filename']").val($(obj).parent().parent().find("input[name='hidden_filename']").val());
				$("#filename").html($(obj).parent().parent().find("input[name='hidden_filename']").val());
				$("#subType").html(data);
				$("#inputModal").modal("show");
			}
		})

		/*modify by FZ 2024-05-16 根据不同的档案类型，调用转换值接口，生效日期描述调整  begin*/
		var effdtFromLabel = "生效日期：";
		var effdtToLabel = "失效日期：";
		var education1 = "";
		var studyForm1 = "";
		var titleLevel1 = "";
		var titleSeries1 = "";
		var bankCode1 = "";
		var sexCode1 = "";
		var stateCode1 = "";
		var cityCode1 = "";
        /*默认隐藏教育信息区块，身份证，银行卡，资格证书，国家技术职称区块*/
	    $("#data_T06").hide();
	    $("#data_T08").hide();
	    $("#data_T09").hide();
 		$("#data_T13").hide();
 		$("#data_T14").hide();
		switch (type) {
  			case "T06": 
	 			/*显示教育信息区块*/
	     		$("#data_T06").show();

				/*查询教育信息*/
				$.ajax({
						type: "POST",
						url: window.cfg.root_iscript +  "IScript_getArchiveDetailInfo",
						data: {
							type: type,
							guid: $(obj).parent().parent().find("input[name='hidden_guid']").val()
						},
						dataType: "json",
						success: function(dataT06, textStatus, jqXHR){	
                        
						$("#graduateDt").val(dataT06.graduateDt);
						$("#schoolCode").val(dataT06.schoolCode);	
						$("#schoolName").val(dataT06.schoolName);	
						
						$("#otherSchool").val(dataT06.otherSchool);	
					
						$("#major").val(dataT06.major);

						if (dataT06.highEduFlag == "Y") {
							document.getElementById('highEduFlag').checked = true;
						} else {
							document.getElementById('highEduFlag').checked = false;
						}
						if (dataT06.firstEduFlag == "Y") {
							document.getElementById('firstEduFlag').checked = true;
						} else {
							document.getElementById('firstEduFlag').checked = false;
						}
						// 记录学历和学习类型变量
						education1 =dataT06.education;
						studyForm1 =dataT06.studyForm;

						/*学历转换值*/
						$.ajax({
								type: "POST",
								url: window.cfg.root_iscript +  "IScript_getEducation",
								data: { 
									education:education1
								},
								dataType: "html",
								success: function(data, textStatus, jqXHR){			
									$("#education").html(data);
								}

						})

						/*学习形式转换值*/
						$.ajax({
								type: "POST",
								url: window.cfg.root_iscript +  "IScript_getStudyForm",
								data: {
									studyForm:studyForm1
								},
								dataType: "html",
								success: function(data, textStatus, jqXHR){			
									$("#studyForm").html(data);			
								}
						})

					}

				})

    		break;
  			case "T08":
				/*显示身份证区块*/
	     		$("#data_T08").show();

				/*查询身份证信息*/
				$.ajax({
						type: "POST",
						url: window.cfg.root_iscript +  "IScript_getArchiveDetailInfo",
						data: {
							type: type,
							guid: $(obj).parent().parent().find("input[name='hidden_guid']").val()
						},
						dataType: "json",
						success: function(dataT08, textStatus, jqXHR){	
               
						$("#displayName").val(dataT08.displayName);		
						$("#birthDate").val(dataT08.birthDate);
						$("#sexCode").val(dataT08.sexCode);
						$("#nationalId").val(dataT08.nationalId);
						$("#stateCode").val(dataT08.stateCode);
						$("#cityCode").val(dataT08.cityCode);
						$("#nidAddress").val(dataT08.nidAddress);

						// 记录性别,州省，城市
						sexCode1 =dataT08.sexCode;
						stateCode1 =dataT08.stateCode;
						cityCode1 = dataT08.cityCode;

						/*性别列表*/
						$.ajax({
								type: "POST",
								url: window.cfg.root_iscript +  "IScript_getSexList",
								data: {
									sexCode:sexCode1
								},
								dataType: "html",
								success: function(data, textStatus, jqXHR){			
									$("#sexCode").html(data);		
								}
						})
						/*州省列表*/
						$.ajax({
								type: "POST",
								url: window.cfg.root_iscript +  "IScript_getStateList",
								data: {
									stateCode:stateCode1
								},
								dataType: "html",
								success: function(data, textStatus, jqXHR){			
									$("#stateCode").html(data);	
  					    		
								}
						})
						/*城市列表*/
						$.ajax({
							type: "POST",
							url: window.cfg.root_iscript +  "IScript_getCityList",
							data: {
								stateCode:stateCode1,
								cityCode: cityCode1
							},
							dataType: "html",
							success: function(data, textStatus, jqXHR){
									$("#cityCode").html(data);
								}
						}) 
					}

				})
    		break;
  			case "T09":
				/*显示银行卡区块*/
	     		$("#data_T09").show();

				/*查询银行卡信息*/
				$.ajax({
						type: "POST",
						url: window.cfg.root_iscript +  "IScript_getArchiveDetailInfo",
						data: {
							type: type,
							guid: $(obj).parent().parent().find("input[name='hidden_guid']").val()
						},
						dataType: "json",
						success: function(dataT09, textStatus, jqXHR){	
                        
						$("#bankCode").val(dataT09.bankCode);		
						$("#bankAccount").val(dataT09.bankAccount);
						// 记录银行ID
						bankCode1 =dataT09.bankCode;
						/*获取银行ID列表*/
						$.ajax({
								type: "POST",
								url: window.cfg.root_iscript +  "IScript_getBankList",
								data: { 
									bankCode:bankCode1
								},
								dataType: "html",
								success: function(data, textStatus, jqXHR){			
									$("#bankCode").html(data);
								}

						})
					}

				})
    		break;
  			case "T13":
				/*显示资格证书区块*/
	     		$("#data_T13").show();
				effdtFromLabel = "*获得日期：";
				effdtToLabel = "到期日期：";


				/*查询资格证书信息*/
				$.ajax({
						type: "POST",
						url: window.cfg.root_iscript +  "IScript_getArchiveDetailInfo",
						data: {
							type: type,
							guid: $(obj).parent().parent().find("input[name='hidden_guid']").val()
						},
						dataType: "json",
						success: function(dataT13, textStatus, jqXHR){	
						$("#certCode").val(dataT13.certCode);
						$("#certName").val(dataT13.certName);
						$("#otherCertName").val(dataT13.otherCertName);		
						
					}

				})

    		break;
  			case "T14":
				/*显示国家技术职称区块*/
	     		$("#data_T14").show();
				effdtFromLabel = "*评定日期：";

				/*查询国家技术职称信息*/
				$.ajax({
						type: "POST",
						url: window.cfg.root_iscript +  "IScript_getArchiveDetailInfo",
						data: {
							type: type,
							guid: $(obj).parent().parent().find("input[name='hidden_guid']").val()
						},
						dataType: "json",
						success: function(dataT14, textStatus, jqXHR){	
                        
						$("#titleCode").val(dataT14.titleCode);		
						$("#titleName").val(dataT14.titleName);
						// 记录职称等级和职称系列变量
						titleLevel1 =dataT14.titleLevel;
						titleSeries1 =dataT14.titleSeries;

						/*获取职称等级列表*/
						$.ajax({
								type: "POST",
								url: window.cfg.root_iscript +  "IScript_getTitleLevel",
								data: { 
									titleLevel:titleLevel1
								},
								dataType: "html",
								success: function(data, textStatus, jqXHR){			
									$("#titleLevel").html(data);
								}

						})

						/*获取职称系列列表*/
						$.ajax({
								type: "POST",
								url: window.cfg.root_iscript +  "IScript_getTitleSeries",
								data: {
									titleSeries:titleSeries1
								},
								dataType: "html",
								success: function(data, textStatus, jqXHR){			
									$("#titleSeries").html(data);			
								}
						})

					}

				})
    		break;
		}
        document.getElementById("effdtFromLabel").innerText = effdtFromLabel;
		/*添加数据标识为N*/
		addFlg="N";
		/*modify by FZ 2024-05-16 根据不同的档案类型，调用转换值接口，生效日期描述调整  end*/

	};
	function addArchive () {
		var type = $("select[name='type'] option:selected").val();
		// console.log("addArchive======",type)
		$.ajax({
			type: "POST",
			url: window.cfg.root_iscript +  "IScript_getArchiveSubType",
			data: {
				type: type
			},
			dataType: "html",
			success: function(data, textStatus, jqXHR){
				if (subFlg !== "Y") {
					$("#sub-group").hide();
				} else {
					$("#sub-group").show();
				}
				if (effFlg !== "Y") {
					$("#date-group").hide();
				} else {
					$("#date-group").show();
				}
				$("#subType").html(data);
				$("#inputModal").modal("show");
			}
		})

		/*modify by FZ 2024-05-16 根据不同的档案类型，调用转换值接口，生效日期描述调整  begin*/

		/* GUID值清空处理 */
        $("input[name='guid']").val("");

		var effdtFromLabel = "生效日期：";
		var effdtToLabel = "失效日期：";
		var sexCode1 = "";
        /*默认隐藏教育信息区块，身份证，银行卡，资格证书，国家技术职称区块*/
	    $("#data_T06").hide();
	    $("#data_T08").hide();
	    $("#data_T09").hide();
		$("#data_T13").hide();
 		$("#data_T14").hide();
		switch (type) {
  			case "T06": 
	 			/*显示教育信息区块*/
	     		$("#data_T06").show();
				/*学历转换值*/
				$.ajax({
						type: "POST",
						url: window.cfg.root_iscript +  "IScript_getEducation",
						data: {
						},
						dataType: "html",
						success: function(data, textStatus, jqXHR){			
							$("#education").html(data);			
						}
				})

				/*学习形式转换值*/
				$.ajax({
						type: "POST",
						url: window.cfg.root_iscript +  "IScript_getStudyForm",
						data: {
						},
						dataType: "html",
						success: function(data, textStatus, jqXHR){			
							$("#studyForm").html(data);			
						}
				})

    		break; 
  			case "T08":
				/*显示身份证区块*/
	     		$("#data_T08").show();

				/*查询银行卡信息*/
				$.ajax({
						type: "POST",
						url: window.cfg.root_iscript +  "IScript_getNidInfo",
						data: {
						},
						dataType: "json",
						success: function(dataT08, textStatus, jqXHR){	
                        
						$("#displayName").val(dataT08.displayName);		
						$("#birthDate").val(dataT08.birthDate);
						$("#sexCode").val(dataT08.sexCode);
						$("#nationalId").val(dataT08.nationalId);
						// 记录性别
						sexCode1 =dataT08.sexCode;

						/*性别列表*/
						$.ajax({
								type: "POST",
								url: window.cfg.root_iscript +  "IScript_getSexList",
								data: {
									sexCode:sexCode1
								},
								dataType: "html",
								success: function(data, textStatus, jqXHR){			
									$("#sexCode").html(data);			
								}
						})
						/*州省列表*/
						$.ajax({
								type: "POST",
								url: window.cfg.root_iscript +  "IScript_getStateList",
								data: {
								},
								dataType: "html",
								success: function(data, textStatus, jqXHR){			
									$("#stateCode").html(data);	
  					    		
								}
						})
					}

				})

    		break;
  			case "T09": 
	 			/*显示银行卡区块*/
	     		$("#data_T09").show();			
				/*银行ID*/
				$.ajax({
						type: "POST",
						url: window.cfg.root_iscript +  "IScript_getBankList",
						data: {
						},
						dataType: "html",
						success: function(data, textStatus, jqXHR){			
							$("#bankCode").html(data);			
						}
				})

    		break; 
  			case "T13":
				/*显示资格证书区块*/
	     		$("#data_T13").show();
				effdtFromLabel = "*获得日期：";
				effdtToLabel = "到期日期：";
    		break;
  			case "T14":
				/*显示国家技术职称区块*/
	     		$("#data_T14").show();
				effdtFromLabel = "*评定日期：";

				/*获取职称等级列表*/
				$.ajax({
						type: "POST",
						url: window.cfg.root_iscript +  "IScript_getTitleLevel",
						data: {
						},
						dataType: "html",
						success: function(data, textStatus, jqXHR){			
							$("#titleLevel").html(data);			
						}
				})

				/*获取职称系列列表*/
				$.ajax({
						type: "POST",
						url: window.cfg.root_iscript +  "IScript_getTitleSeries",
						data: {
						},
						dataType: "html",
						success: function(data, textStatus, jqXHR){			
							$("#titleSeries").html(data);			
						}
				})

    		break;
		}
        document.getElementById("effdtFromLabel").innerText = effdtFromLabel;
		document.getElementById("effdtToLabel").innerText = effdtToLabel;

		/*添加数据标识为Y*/
		addFlg="Y";
		/*modify by FZ 2024-05-16 根据不同的档案类型，调用转换值接口，生效日期描述调整  end*/

	};

	function getAttach (obj) {
		$.ajax({
			type: "POST",
			url: window.cfg.root_iscript +  "IScript_getArchive",
			data: {
				guid: $(obj).parent().parent().find("input[name='hidden_guid']").val(),
				extension	: $(obj).parent().find("input[name='hidden_extension']").val(),
				sysfilename	: $(obj).parent().find("input[name='hidden_sysfilename']").val()

			},
			dataType: "html",
			success: function(data, textStatus, jqXHR){
				window.open(data);
			}
		})
	};

	function uploadFile () {
		var $archiveInput = $("input[name='archive']");
		$archiveInput.trigger("click");
	};
	function saveArchive () {
		if (isNullOrEmpty($("select[name='subType']").val()) && subFlg === "Y") {
            $.Zebra_Dialog("请选择子类型",{'type': 'information','title': '错误'});
			return;
		}
		/*modify by FZ 2024-06-04 注释日期必输校验  begin*/
		/*
		if (isNullOrEmpty($("input[name='effdtFrom']").val()) && effFlg === "Y") {
            $.Zebra_Dialog("请选择生效日期",{'type': 'information','title': '错误'});
			return;
		}
		if (isNullOrEmpty($("input[name='effdtTo']").val()) && effFlg === "Y") {
            $.Zebra_Dialog("请选择失效日期",{'type': 'information','title': '错误'});
			return;
		}
		*/
		/*modify by FZ 2024-06-04 注释日期必输校验  end*/

		if (isNullOrEmpty($("input[name='filename']").val())) {
            $.Zebra_Dialog("请上传附件",{'type': 'information','title': '错误'});
			return;
		}

	    /*modify by FZ 2024-05-17 根据不同的档案类型，校验字段必输  begin*/
		var type = $("select[name='type'] option:selected").val();
		switch (type) {
  			case "T06": 
		 		if (isNullOrEmpty($("input[name='graduateDt']").val())) {
		            $.Zebra_Dialog("请选择毕业日期",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("input[name='schoolCode']").val()) && isNullOrEmpty($("input[name='otherSchool']").val())) {
		            $.Zebra_Dialog("请填写学校",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("select[name='education']").val())) {
		            $.Zebra_Dialog("请选择学历",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("select[name='studyForm']").val())) {
		            $.Zebra_Dialog("请选择学习方式",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("input[name='major']").val())) {
		            $.Zebra_Dialog("请填写专业",{'type': 'information','title': '错误'});
					return;
				}
				/*2024-06-11 注释最高学历和第一学历
				if ((document.getElementById('firstEduFlag').checked == true)  && ( $("select[name='education']").val() == "11" || $("select[name='education']").val() == "12" )) {
					$.Zebra_Dialog("第一学历不能是本科以上学历",{'type': 'information','title': '错误'});
					return;
				}
				*/
    		break;
			case "T08":
				// 获取当前日期字符串
				const currentDate = new Date();
				const year = currentDate.getFullYear();
				const month = String(currentDate.getMonth() + 1).padStart(2, '0');
				const day = String(currentDate.getDate()).padStart(2, '0');
				const formattedDate = `${year}-${month}-${day}`;

				if (isNullOrEmpty($("input[name='effdtFrom']").val()) && effFlg === "Y") {
		            $.Zebra_Dialog("请选择生效日期",{'type': 'information','title': '错误'});
					return;
				}
				if (isNullOrEmpty($("input[name='effdtTo']").val()) && effFlg === "Y") {
		            $.Zebra_Dialog("请选择失效日期",{'type': 'information','title': '错误'});
					return;
				}
                else
				if ($("input[name='effdtTo']").val() <= formattedDate) {
		            $.Zebra_Dialog("失效日期必须大于当前日期",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("select[name='stateCode']").val())) {
		            $.Zebra_Dialog("请选择州/省",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("select[name='cityCode']").val())) {
		            $.Zebra_Dialog("请选择城市",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("input[name='nidAddress']").val())) {
		            $.Zebra_Dialog("请填写地址",{'type': 'information','title': '错误'});
					return;
				}   					
			break;
  			case "T09":
		 		if (isNullOrEmpty($("select[name='bankCode']").val())) {
		            $.Zebra_Dialog("请选择银行ID",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("input[name='bankAccount']").val())) {
		            $.Zebra_Dialog("请填写账号",{'type': 'information','title': '错误'});
					return;
				}    		
    		break;

			case "T13":

				if (isNullOrEmpty($("input[name='effdtFrom']").val())) {
		            $.Zebra_Dialog("请选择获得日期",{'type': 'information','title': '错误'});
					return;
				}	
		 		if (isNullOrEmpty($("input[name='certCode']").val())) {
		            $.Zebra_Dialog("请选择证书代码",{'type': 'information','title': '错误'});
					return;
				}
				else{
					if ($("input[name='certCode']").val() != "90" && $("input[name='otherCertName']").val().trim() != '') {
		            	$.Zebra_Dialog("选择非其他证书时，其他证书名称不可填",{'type': 'information','title': '错误'});
						return;
					}	

				}
		 		if ($("input[name='certCode']").val() == "90" && isNullOrEmpty($("input[name='otherCertName']").val())) {
		            $.Zebra_Dialog("请填写其他证书名称",{'type': 'information','title': '错误'});
					return;
				}				
 		
    		break;
  			case "T14":

				if (isNullOrEmpty($("input[name='effdtFrom']").val())) {
		            $.Zebra_Dialog("请选择评定日期",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("select[name='titleLevel']").val())) {
		            $.Zebra_Dialog("请选择职称等级",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("select[name='titleSeries']").val())) {
		            $.Zebra_Dialog("请选择职称系列",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("input[name='titleCode']").val())) {
		            $.Zebra_Dialog("请填写职称名称",{'type': 'information','title': '错误'});
					return;
				}    		
    		break;
			default:
				if (isNullOrEmpty($("input[name='effdtFrom']").val()) && effFlg === "Y") {
		            $.Zebra_Dialog("请选择生效日期",{'type': 'information','title': '错误'});
					return;
				}
				if (isNullOrEmpty($("input[name='effdtTo']").val()) && effFlg === "Y") {
		            $.Zebra_Dialog("请选择失效日期",{'type': 'information','title': '错误'});
					return;
				}
	
		}
		/*modify by FZ 2024-05-17 根据不同的档案类型，校验字段必输  end*/

		$.ajax({
			type: "POST",
			url: window.cfg.root_iscript +  "IScript_saveArchive",
			data: {
				type: $("select[name='type']").val(),
				subType: $("select[name='subType']").val(),
				effdtFrom: $("input[name='effdtFrom']").val(),
				effdtTo: $("input[name='effdtTo']").val(),
				descr: $("input[name='descr']").val(),
				filename: $("input[name='filename']").val(),
				base64: $("input[name='base64']").val(),

				/*modify by FZ 2024-05-17 添加区块详细信息  begin*/
				// guid:  $("input[name='guid']").val() 
				guid:  $("input[name='guid']").val(),
	
				graduateDt: $("input[name='graduateDt']").val(),
				schoolCode: $("input[name='schoolCode']").val(),
				education: $("select[name='education']").val(),
				studyForm: $("select[name='studyForm']").val(),
				otherSchool: $("input[name='otherSchool']").val(),
				major: $("input[name='major']").val(),
				/*2024-06-11 注释最高学历和第一学历
				highEduFlag: document.getElementById('highEduFlag').checked,
				firstEduFlag:document.getElementById('firstEduFlag').checked,
				*/

				displayName: $("input[name='displayName']").val(), 
				birthDate: $("input[name='birthDate']").val(),  
				sexCode: $("select[name='sexCode']").val(),
				nationalId: $("input[name='nationalId']").val(),  
				stateCode: $("select[name='stateCode']").val(),  
				cityCode: $("select[name='cityCode']").val(),
				nidAddress: $("input[name='nidAddress']").val(),  

				bankCode: $("select[name='bankCode']").val(),
				bankAccount: $("input[name='bankAccount']").val(),                 

				certCode: $("input[name='certCode']").val(),
				otherCertName: $("input[name='otherCertName']").val(), 

				titleCode: $("input[name='titleCode']").val(),
				titleLevel: $("select[name='titleLevel']").val(),
				titleSeries: $("select[name='titleSeries']").val(),
				/*modify by FZ 2024-05-17 添加区块详细信息  end*/
			},
			dataType: "html",
			success: function(data, textStatus, jqXHR){

				if (data !== "success") {
            		$.Zebra_Dialog(data,{'type': 'information','title': '错误'});
				} else {
					$("#inputModal").modal("hide");				
					getArchive();
				}
			}
		})
	}
	function checkArchive () {
		if (isNullOrEmpty($("select[name='subType']").val()) && subFlg === "Y") {
            $.Zebra_Dialog("请选择子类型！！！",{'type': 'information','title': '错误'});
			return;
		}

		/*modify by FZ 2024-06-04 注释日期必输校验  begin*/
		/*
		if (isNullOrEmpty($("input[name='effdtFrom']").val()) && effFlg === "Y") {
            $.Zebra_Dialog("请选择生效日期",{'type': 'information','title': '错误'});
			return;
		}
		if (isNullOrEmpty($("input[name='effdtTo']").val()) && effFlg === "Y") {
            $.Zebra_Dialog("请选择失效日期",{'type': 'information','title': '错误'});
			return;
		}
		*/
		/*modify by FZ 2024-06-04 注释日期必输校验  end*/

		if (isNullOrEmpty($("input[name='filename']").val())) {
            $.Zebra_Dialog("请上传附件",{'type': 'information','title': '错误'});
			return;
		}

		/*modify by FZ 2024-05-17 根据不同的档案类型，校验字段必输  begin*/
		var type = $("select[name='type'] option:selected").val();

		switch (type) {
  			case "T06": 
		 		if (isNullOrEmpty($("input[name='graduateDt']").val())) {
		            $.Zebra_Dialog("请选择毕业日期",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("input[name='schoolCode']").val()) && isNullOrEmpty($("input[name='otherSchool']").val())) {
		            $.Zebra_Dialog("请填写学校",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("select[name='education']").val())) {
		            $.Zebra_Dialog("请选择学历",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("select[name='studyForm']").val())) {
		            $.Zebra_Dialog("请选择学习方式",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("input[name='major']").val())) {
		            $.Zebra_Dialog("请填写专业",{'type': 'information','title': '错误'});
					return;
				}
				/*2024-06-11 注释最高学历和第一学历
				if ((document.getElementById('firstEduFlag').checked == true)  && ( $("select[name='education']").val() == "11" || $("select[name='education']").val() == "12" )) {
					$.Zebra_Dialog("第一学历不能是本科以上学历",{'type': 'information','title': '错误'});
					return;
				}
				*/
    		break;
			case "T08":
				// 获取当前日期字符串
				const currentDate = new Date();
				const year = currentDate.getFullYear();
				const month = String(currentDate.getMonth() + 1).padStart(2, '0');
				const day = String(currentDate.getDate()).padStart(2, '0');
				const formattedDate = `${year}-${month}-${day}`;

				if (isNullOrEmpty($("input[name='effdtFrom']").val()) && effFlg === "Y") {
		            $.Zebra_Dialog("请选择生效日期",{'type': 'information','title': '错误'});
					return;
				}
				if (isNullOrEmpty($("input[name='effdtTo']").val()) && effFlg === "Y") {
		            $.Zebra_Dialog("请选择失效日期",{'type': 'information','title': '错误'});
					return;
				}
                else
				if ($("input[name='effdtTo']").val() <= formattedDate) {
		            $.Zebra_Dialog("失效日期必须大于当前日期",{'type': 'information','title': '错误'});
					return;
				}					
		 		if (isNullOrEmpty($("select[name='stateCode']").val())) {
		            $.Zebra_Dialog("请选择州/省",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("select[name='cityCode']").val())) {
		            $.Zebra_Dialog("请选择城市",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("input[name='nidAddress']").val())) {
		            $.Zebra_Dialog("请填写地址",{'type': 'information','title': '错误'});
					return;
				}    		
    		break;
  			case "T09":
		 		if (isNullOrEmpty($("select[name='bankCode']").val())) {
		            $.Zebra_Dialog("请选择银行ID",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("input[name='bankAccount']").val())) {
		            $.Zebra_Dialog("请填写账号",{'type': 'information','title': '错误'});
					return;
				}    		
    		break;
			case "T13":

				if (isNullOrEmpty($("input[name='effdtFrom']").val())) {
		            $.Zebra_Dialog("请选择获得日期",{'type': 'information','title': '错误'});
					return;
				}				

		 		if (isNullOrEmpty($("input[name='certCode']").val())) {
		            $.Zebra_Dialog("请选择证书代码",{'type': 'information','title': '错误'});
					return;
				}
				else{
					if ($("input[name='certCode']").val() != "90" && $("input[name='otherCertName']").val().trim() != '') {
		            	$.Zebra_Dialog("选择非其他证书时，其他证书名称不可填",{'type': 'information','title': '错误'});
						return;
					}	

				}				

		 		if ($("input[name='certCode']").val() == "90" && isNullOrEmpty($("input[name='otherCertName']").val())) {
		            $.Zebra_Dialog("请填写其他证书名称",{'type': 'information','title': '错误'});
					return;
				}	
 		
    		break;
  			case "T14":

				if (isNullOrEmpty($("input[name='effdtFrom']").val())) {
		            $.Zebra_Dialog("请选择评定日期",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("select[name='titleLevel']").val())) {
		            $.Zebra_Dialog("请选择职称等级",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("select[name='titleSeries']").val())) {
		            $.Zebra_Dialog("请选择职称系列",{'type': 'information','title': '错误'});
					return;
				}
		 		if (isNullOrEmpty($("input[name='titleCode']").val())) {
		            $.Zebra_Dialog("请填写职称名称",{'type': 'information','title': '错误'});
					return;
				}    		
    		break;
			default:
				if (isNullOrEmpty($("input[name='effdtFrom']").val()) && effFlg === "Y") {
		            $.Zebra_Dialog("请选择生效日期",{'type': 'information','title': '错误'});
					return;
				}
				if (isNullOrEmpty($("input[name='effdtTo']").val()) && effFlg === "Y") {
		            $.Zebra_Dialog("请选择失效日期",{'type': 'information','title': '错误'});
					return;
				}
	
		}
		/*modify by FZ 2024-05-17 根据不同的档案类型，校验字段必输  end*/
  
		$.ajax({
			type: "POST",
			url: window.cfg.root_iscript +  "IScript_checkArchive",
			data: {
				type: $("select[name='type']").val(),
				/*modify by FZ 2024-05-17 添加校验详情数据重复字段  begin*/
				// subType: $("select[name='subType']").val()
				subType: $("select[name='subType']").val(),
				education: $("select[name='education']").val(),
				certCode: $("input[name='certCode']").val(),
				titleCode: $("input[name='titleCode']").val(),
				guid:  $("input[name='guid']").val(),
                bankCode:$("select[name='bankCode']").val()
				/*modify by FZ 2024-05-17 添加校验详情数据重复字段  begin*/
			},
			dataType: "html",
			success: function(data, textStatus, jqXHR){
				if (data !== "success") {
					/*modify by FZ 2024-05-17 当不等于success时，弹出错误  begin*/
					/*
            		$.Zebra_Dialog(data,{'type': 'question','title': '警告',
                                         'buttons': [
                                              {caption: '确认', callback:function() {saveArchive();} },
                                              {caption: '取消', callback:function() {return;} }
                                          ]});
					*/
            		$.Zebra_Dialog(data,{'type': 'question','title': '错误',
                                         'buttons': [
                                              {caption: '取消', callback:function() {return;} }
                                          ]});
				} else {
                    saveArchive();
				}
			}
		})
	}
	$("input[name='archive']").change(function (e) {
		var reader = new FileReader();
		// console.log('文件上传了')
	    reader.onload = (function (file) {
	        return function (e) {
	        	
				/*modify by FZ 2024-05-21 文件重命名:档案类型+工号+姓名+时间（精确到秒）  begin*/
				// $("#filename").html(file.name);
	        	// $("input[name='filename']").val(file.name);
			    
				/*获取文件名称*/
				$.ajax({
						type: "POST",
						url: window.cfg.root_iscript +  "IScript_getArchiveFileName",
						data: {
							typeText:$("select[name='type'] option:selected").text(),
							fileName:file.name
						},
						dataType: "json",
						success: function(dataFileName, textStatus, jqXHR){			
							$("input[name='filename']").val(dataFileName.newFileName);	
							$("#filename").html(dataFileName.newFileName);	
						}
				})	
               
				/*modify by FZ 2024-05-21 文件重命名:档案类型+工号+姓名+时间（精确到秒）  end*/
	        	$("input[name='base64']").val(this.result);
				
	        };
	    })(e.target.files[0]);
	    reader.readAsDataURL(e.target.files[0])
	})
	$("#inputModal").on("hide.bs.modal", function(){
	    $("#filename").html("");
		/*add by FZ 2024-05-29 弹框关闭后清空附件，防止上传附件相同时上传事件不触发  begin*/
		$("input[name='filename']").val("");
		$("input[name='archive']").val("");
		/*add by FZ 2024-05-29 弹框关闭后清空附件，防止上传附件相同时上传事件不触发  begin*/
		document.getElementById("addForm").reset();
	})
</script>